import 'package:json_annotation/json_annotation.dart';
import 'image_model.dart';
import 'recipe_model.dart';
import 'user_model.dart';
import 'video_model.dart';
import 'story_model.dart';
part 'recommend_model.g.dart';

@JsonSerializable()
class RecommendModel {
  RecommendFeedModel top;
  RecommendFeedModel group;
  RecommendFeedModel more;

  RecommendModel(this.top, this.group, this.more);

  factory RecommendModel.fromJson(Map<String, dynamic> json) =>
      _$RecommendModelFromJson(json);

  Map<String, dynamic> toJson() => _$RecommendModelToJson(this);
}

@JsonSerializable()
class RecommendFeedModel {
  String create_time;
  int id;
  String release_time;
  int type;
  String update_time;
  List<RecommendFoodModel>? foods;
  String? title;
  List<RecipeModel>? recipes;
  List<StoryModel>? stories;

  RecommendFeedModel(this.create_time, this.id, this.release_time, this.type,
      this.update_time, this.foods, this.title, this.recipes, this.stories);

  factory RecommendFeedModel.fromJson(Map<String, dynamic> json) =>
      _$RecommendFeedModelFromJson(json);

  Map<String, dynamic> toJson() => _$RecommendFeedModelToJson(this);
}

@JsonSerializable()
class RecommendFoodModel {
  String create_time;
  int id;
  int type;
  String release_time;
  String update_time;
  RecipeModel data;

  RecommendFoodModel(this.create_time, this.id, this.type, this.release_time,
      this.update_time, this.data);

  factory RecommendFoodModel.fromJson(Map<String, dynamic> json) =>
      _$RecommendFoodModelFromJson(json);

  Map<String, dynamic> toJson() => _$RecommendFoodModelToJson(this);
}
